package type.robot;

import util.Null;

import java.lang.reflect.Proxy;

/**
 * @Date 2021/5/5 11:16 上午
 * @Author dengxin
 */
public class NullRobot {

    public static Robot newNullRobot(Class<? extends Robot> type) {
        return (Robot) Proxy.newProxyInstance(Null.class.getClassLoader(), new Class[]{Null.class, Robot.class}, new NullRobotProxyHandler(type));
    }

    public static void main(String[] args) {
        Robot[] bots = {newNullRobot(SnowRemovalRobot.class)};
        for(Robot robot : bots) {
            Robot.Test.test(robot);
        }
    }
}
